package com.station.administrators.controller;

import com.open.capacity.common.web.Result;
import com.open.capacity.common.model.CompanyModel;
import com.station.administrators.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author YangGang
 * @Title: 公司信息
 * @Description: TODO
 * @date 2021/6/29/10:03
 */
@RestController
@RequestMapping("/company")
public class CompanyController {
    @Autowired
    private CompanyService companyService;

    @PostMapping("/update")
    public Object update(@RequestBody CompanyModel company){
        companyService.update(company);
        return Result.succeed("修改成功！");
    }
    @GetMapping("/findAll")
    public Object findAll(){
        List<CompanyModel> company=companyService.findAll();
        return Result.succeed(company,"公司信息");
    }
}
